home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / RIncludes / ConditionalMacros.r < prev    next >
Encoding:
Text File  |  1998-04-17  |  8.7 KB  |  241 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.r
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.1
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __CONDITIONALMACROS_R__
  20. #define __CONDITIONALMACROS_R__
  21.  
  22. /****************************************************************************************************
  23.     UNIVERSAL_INTERFACES_VERSION
  24.     
  25.         0x0310 => version 3.1
  26.         0x0301 => version 3.0.1
  27.         0x0300 => version 3.0
  28.         0x0210 => version 2.1
  29.         This conditional did not exist prior to version 2.1
  30. ****************************************************************************************************/
  31. #define UNIVERSAL_INTERFACES_VERSION 0x0310
  32.  
  33. /****************************************************************************************************
  34.  
  35.     TARGET_CPU_≈    
  36.     These conditionals specify which microprocessor instruction set is being
  37.     generated.  At most one of these is true, the rest are false.
  38.  
  39.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  40.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  41.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  42.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  43.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  44.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  45.  
  46.  
  47.     TARGET_OS_≈    
  48.     These conditionals specify in which Operating System the generated code will
  49.     run. At most one of the these is true, the rest are false.
  50.  
  51.         TARGET_OS_MAC            - Generate code will run under Mac OS
  52.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  53.         TARGET_OS_UNIX            - Generate code will run under some unix 
  54.  
  55.  
  56.     TARGET_RT_≈    
  57.     These conditionals specify in which runtime the generated code will
  58.     run. This is needed when the OS and CPU support more than one runtime
  59.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  60.  
  61.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  62.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  63.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  64.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  65.  
  66.  
  67.     PRAGMA_≈
  68.     These conditionals specify whether the compiler supports particular #pragma's
  69.     
  70.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  71.         PRAGMA_ONCE              - Compiler supports: #pragma once
  72.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  73.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  74.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  75.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  76.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  77.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  78.  
  79.     FOUR_CHAR_CODE
  80.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  81.     is compiled down to the correct value on all compilers.
  82.  
  83.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  84.  
  85.     TYPE_≈
  86.     These conditionals specify whether the compiler supports particular types.
  87.  
  88.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  89.         TYPE_BOOL                - Compiler supports "bool"
  90.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  91.  
  92. ****************************************************************************************************/
  93.  
  94.  
  95.  
  96. /*
  97.     Rez resource compiler from Apple Computer, Inc.    
  98. */
  99.  
  100. #if !defined(Environ_OS_Mac)
  101.     #define Environ_OS_Mac            1
  102.  
  103.     #define TARGET_OS_MAC            1
  104. #elif !defined(TARGET_OS_MAC) && !defined(TARGET_OS_WIN32) && !defined(TARGET_OS_UNIX)
  105.     #define TARGET_OS_MAC                Environ_OS_Mac
  106.     #define TARGET_OS_WIN32                Environ_OS_Win32
  107.     #define TARGET_OS_UNIX                Environ_OS_Unix
  108.  
  109.     #define TARGET_CPU_MIPS             Environ_CPU_MIPS
  110.     #define TARGET_CPU_SPARC             Environ_CPU_SPARC
  111.     #define TARGET_CPU_X86                 Environ_CPU_X86
  112.     #define TARGET_CPU_PPC                 Environ_CPU_PPC
  113. #endif
  114.  
  115. #if !defined(TARGET_OS_MAC)
  116.     #define TARGET_OS_MAC        0
  117. #endif
  118. #if !defined(TARGET_OS_WIN32)
  119.     #define TARGET_OS_WIN32        0
  120. #endif
  121. #if !defined(TARGET_OS_UNIX)
  122.     #define TARGET_OS_UNIX        0
  123. #endif
  124. #if (TARGET_OS_MAC + TARGET_OS_WIN32 + TARGET_OS_UNIX) != 1
  125.     #error one and only one please
  126. #endif
  127.  
  128. #if !defined(TARGET_CPU_MIPS)
  129.     #define TARGET_CPU_MIPS        0
  130. #endif
  131. #if !defined(TARGET_CPU_SPARC)
  132.     #define TARGET_CPU_SPARC    0
  133. #endif
  134. #if !defined(TARGET_CPU_X86)
  135.     #define TARGET_CPU_X86        0
  136. #endif
  137. #if !defined(TARGET_CPU_PPC)
  138.     #define TARGET_CPU_PPC        0
  139. #endif
  140.  
  141. #if (TARGET_OS_UNIX) && ((TARGET_CPU_PPC + TARGET_CPU_MIPS + TARGET_CPU_SPARC + TARGET_CPU_X86) != 1)
  142.     #error one and only one please
  143. #endif
  144.  
  145. #if TARGET_OS_WIN32 || TARGET_CPU_X86
  146.     #define TARGET_RT_LITTLE_ENDIAN        1
  147.     #define TARGET_RT_BIG_ENDIAN        0
  148. #else
  149.     #define TARGET_RT_LITTLE_ENDIAN        0
  150.     #define TARGET_RT_BIG_ENDIAN        1
  151. #endif
  152.  
  153. #if !defined(TARGET_REZ_MAC_68K)
  154.     #define TARGET_REZ_MAC_68K        0
  155. #endif
  156. #if !defined(TARGET_REZ_MAC_PPC)
  157.     #define TARGET_REZ_MAC_PPC        0
  158. #endif
  159.  
  160.  
  161.  
  162. /****************************************************************************************************
  163.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  164.  
  165.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  166.     GENERATING68K            - Compiler is generating 68k family instructions
  167.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  168.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  169.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  170.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  171.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  172.  
  173. ****************************************************************************************************/
  174. #if TARGET_OS_MAC
  175. #define GENERATINGPOWERPC TARGET_CPU_PPC
  176. #define GENERATING68K TARGET_CPU_68K
  177. #define GENERATING68881 TARGET_RT_MAC_68881
  178. #define GENERATINGCFM TARGET_RT_MAC_CFM
  179. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  180. /*
  181.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  182.           interface files for System 7 and Copland.  Now that Copland
  183.           is canceled, all FOR_ conditionals have been removed from
  184.           the interface files.  But, just in case you someone got an 
  185.           interface file that uses them, the following sets the FOR_≈
  186.           conditionals to a consistent, usable state.
  187.  
  188.     #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  189.     #ifndef FOR_PTR_BASED_AE
  190.         #define FOR_PTR_BASED_AE                    0
  191.     #endif
  192.     #define FOR_SYSTEM7_ONLY                        1
  193.     #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  194.     #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  195.     #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  196.     #define FOR_SYSTEM8_COOPERATIVE                    0
  197.     #define FOR_SYSTEM8_PREEMPTIVE                    0
  198. */
  199. #endif
  200.  
  201.  
  202.  
  203. /****************************************************************************************************
  204.  
  205.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  206.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  207.                               are now more sensitive to change because CFM binds by name.  In the 
  208.                               past, system routine names were compiled out to just an A-Trap.  
  209.                               Macros have been added that each map an old name to its new name.  
  210.                               This allows old routine names to be used in existing source files,
  211.                               but the macros only work if OLDROUTINENAMES is true.  This support
  212.                               will be removed in the near future.  Thus, all source code should 
  213.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  214.                               to see if your code has any old names left in it.
  215.     
  216.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  217.                               has been moved from Strings to TextUtils.  It is conditionalized in
  218.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  219.                               This allows developers to upgrade to newer interface files without 
  220.                               having to change the includes in their source code.  But, it allows
  221.                               the slow migration of system calls to more understandable file locations.  
  222.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  223.                               default to false.
  224.  
  225. ****************************************************************************************************/
  226. #ifndef OLDROUTINENAMES
  227. #define OLDROUTINENAMES 0
  228. #endif
  229. #ifndef OLDROUTINELOCATIONS
  230. #define OLDROUTINELOCATIONS 0
  231. #endif
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239. #endif /* __CONDITIONALMACROS_R__ */
  240.  
  241.